package com.lemo.smart.thread;

/**
 * Created by 罗选通 on 2017/12/25.
 */
public class ClientThread extends Thread{
  private Sequence sequence;

  public ClientThread(Sequence sequence) {
    this.sequence = sequence;
  }

  /**
   * If this thread was constructed using a separate
   * <code>Runnable</code> run object, then that
   * <code>Runnable</code> object's <code>run</code> method is called;
   * otherwise, this method does nothing and returns.
   * <p>
   * Subclasses of <code>Thread</code> should override this method.
   *
   * @see #start()
   * @see #stop()
   * @see #Thread(ThreadGroup, Runnable, String)
   */
  @Override
  public void run() {
    for (int i = 0; i <3 ; i++) {
      System.out.println(Thread.currentThread().getName()+"=>"+sequence.getNumber());
    }
  }
}
